home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 098 / curses.arc / CURSES.H next >
Encoding:
C/C++ Source or Header  |  1985-06-24  |  2.7 KB  |  96 lines

  1. #include <stdio.h>
  2. #include <dos.h>
  3. #include <fcntl.h>
  4. #include <sys\types.h>
  5. #include <sys\stat.h>
  6. #include <ctype.h>
  7. #include "scr.h"
  8. #define min(a, b) ( (a <= b) ? a : b)
  9. #define max(a, b) ( a <b) ? b : a)
  10. #define NROWS 24
  11. #define BAD -1
  12. #define GOOD 1
  13. #define NCOLS  80
  14. #define true 1
  15. #define false 0
  16. #define rom_call 0x10
  17. #define HILIT_ON        8
  18. #define BLINK           128             /* may be 176 */
  19. #define REVERSE         0x70
  20. #define NORMAL 7
  21. #define HIGHLIGHT 15
  22. #define BHIGHLIGHT 184
  23. #define UNDERLINE 1
  24. #define clear()         (wclear(stdscr))
  25. #define move(c, c1)     (wmove(stdscr, c, c1))
  26. #define mvclear(x, y)   move(x, y); clrtoeol(); refresh()
  27. #define mvprint(x, y,s) move(x,y); addstr(s)
  28. #define wmvprint(a, x, y, s)  wmove(a, x, y); waddstr(s)
  29. #define delch()         (wdelch(stdscr))
  30. #define deleteln()      (wdeleteln(stdscr))
  31. #define addch(c)        (waddch(stdscr, c))
  32. #define clrtoeol()      (wclrtoeol(stdscr))
  33. #define clrtobot()      (wclrtobot(stdscr))
  34. #define insertln()      (winsertln(stdscr))
  35. #define insch(c)        (winsch(stdscr, c))
  36. #define inch()          (winch(stdscr))
  37. #define standout()      (wstandout(stdscr))
  38. #define standend()      (wstandend(stdscr))
  39. #define scroll()        (wscroll(stdscr))
  40. #define echo()          (0)
  41. #define noecho()        (0)
  42. #define nl()            (0)
  43. #define nonl()          (0)
  44. #define addstr(s)       (waddstr(stdscr, s))
  45. #define refresh()       (wrefresh(stdscr))
  46.  
  47. #define CTRLA   1
  48. #define CTRLB   2
  49. #define CTRLC   3
  50. #define CTRLD   4
  51. #define CTRLE   5
  52. #define CTRLF   6
  53. #define CTRLG   7
  54. #define CTRLH   8
  55. #define CTRLI   9
  56. #define CTRLJ  10
  57. #define CTRLK  11
  58. #define CTRLL  12
  59. #define CTRLM  13
  60. #define CTRLN  14
  61. #define CTRLO  15
  62. #define CTRLP  16
  63. #define CTRLQ  17
  64. #define CTRLR  18
  65. #define CTRLS  19
  66. #define CTRLT  20
  67. #define CTRLU   21
  68. #define CTRLV   22
  69. #define CTRLW  23
  70. #define CTRLX  24
  71. #define CTRLY  25
  72. #define CTRLZ  26
  73. extern char *malloc(), *scr_buff, *strchr(), *strcat();
  74.  
  75. extern int nkey, key_code[100][5], retrace;
  76.  
  77.  
  78. typedef struct win_struct {
  79.         int row_org, col_org;
  80.         int row_max, col_max;
  81.         int row, col;
  82.         int first_row, first_col;
  83.         int last_row, last_col;
  84.         int first_pos, last_pos;
  85.         int char_pos;           /* current char position */
  86.         char *buff;             /* current buffer */
  87.         int no_change;
  88.         int buff_len;            /* total buffer lenght */
  89.         int attrib;              /* atrribute */
  90.         int scroll_fl;          /* scroll flag */
  91.         int box_flag;            /* box flag */
  92.         struct win_struct *next;
  93. } Window;
  94.  
  95. extern Window *stdscr, *firstw, *newwin(), *curr_wind;
  96.